package com.dragon.design.pattern.structural.proxy.jdk;

/**
 * @author dragon
 * @version V1.0.0-RELEASE
 * @date 2019/7/1 19:49
 */
public class OrderServiceDynamicProxyTest {

    public static void main(String[] args) {
        OrderServiceDynamicProxy orderServiceDynamicProxy = new OrderServiceDynamicProxy();
        Order order = new Order();
        order.setOrderInfo("笔记本MacBookPro");
        order.setUserId(1);
        OrderService orderService = new OrderServiceImpl();
        OrderService orderServiceProxy = (OrderService) orderServiceDynamicProxy.getProxy(orderService);
        orderServiceProxy.saveOrder(order);
    }
}
